package com.eightbears.beboy.adapter;

import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eightbears.beboy.R;
import com.eightbears.beboy.base.util.CommonUtils;
import com.eightbears.beboy.entity.ShopManageEntity;

import java.util.List;

public class ShopManageAdapter extends BaseQuickAdapter<ShopManageEntity, BaseViewHolder> {

    public ShopManageAdapter() {
        super(R.layout.item_shop_managers, null);
        List<ShopManageEntity> list = ShopManageEntity.getShopManageItem();
        setNewData(list);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, ShopManageEntity shopManageEntity) {

        CommonUtils.loadImageView(mContext, "", shopManageEntity.getImg(),
                ((ImageView) baseViewHolder.getView(R.id.iv_menu_icon)));
        baseViewHolder.setText(R.id.tv_name, shopManageEntity.getName())
            .addOnClickListener(R.id.ll_root);

        View viewLine = baseViewHolder.getView(R.id.view_line);
        if(shopManageEntity.getName().equals("敬请期待")) {
            viewLine.setVisibility(View.VISIBLE);
        } else {
            viewLine.setVisibility(View.GONE);
        }
    }
}
